@extends('admin/index')
@section('name')
    <h1><span class="label label-default"> 用户详细信息 </span></h1>
    <hr>

    <div class="container">
        <div class="row">
            <div class="col-md-4 col-md-offset-4">
                <form class="form-horizontal" action="{{url('adm/adm/add')}}" name="ckname" >
                    <div class="form-group">
                        <label for="inputEmail3" class="col-sm-2 control-label">用户名:</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="name" placeholder="name" onblur="checkname()" value="{{$res->i_name}}"  readonly>
                            {{--<p id="p" style="display: none">此分类名已存在喔~</p>--}}
                        </div>
                    </div>


                    <div class="form-group">
                        <label for="inputPassword3" class="col-sm-2 control-label">性别</label>
                        <div class="col-sm-10">

                            @if(($res->i_sex) == 1)
                            <label class="radio-inline">
                                <input type="radio" name="" value="1" checked readonlyd>  男
                            </label>
                            <label class="radio-inline">
                                <input type="radio" name="" value="2" readonlyd> 女
                            </label>

                            @elseif(($res->i_sex) == 2)
                                <label class="radio-inline">
                                    <input type="radio" name="" value="1" > 男
                                </label>
                                <label class="radio-inline">
                                    <input type="radio" name="" value="2" checked> 女
                                </label>
                            @else
                            @endif
                        </div>
                    </div>




                    <div class="form-group">
                        <label for="inputPassword3" class="col-sm-2 control-label">生日</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="path" value="{{$res->i_birth}}" readonly>
                        </div>
                    </div>


                    <div class="form-group">
                        <label for="inputPassword3" class="col-sm-2 control-label">血型</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="path" value="{{$res->i_ox}}" readonly>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="inputPassword3" class="col-sm-2 control-label">职业</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="path" value="{{$res->i_occu}}" readonly>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="inputPassword3" class="col-sm-2 control-label">标签</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="path" value="{{$res->i_biref}}" readonly>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="inputPassword3" class="col-sm-2 control-label">博客</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="path" value="{{$res->i_boke}}" readonly>
                        </div>
                    </div>

                    <div class="form-group">
                        <label for="inputPassword3" class="col-sm-2 control-label">简介</label>
                        <div class="col-sm-10">
                            <input type="text" class="form-control" name="path" value="{{$res->i_tag}}" readonly>
                        </div>
                    </div>


                </form>
            </div>
        </div>
    </div>


    <script>


        //用户名验证
        function checkname() {

            var ckname = document.ckname.name.value;
            //var p = document.getElementById('p');
            if (ckname == '') {

                console.log('触发');

            }else{

                $.ajax({
                    type: 'get',
                    url: "{{url('adm/class/ajax')}}/" + ckname,
                    success: function (data) {
                        if (data == 1) {
                            p.style.color = 'red';
                            p.style.display = 'block';
                        }

                        if(data == 2) {

                            p.style.display = 'none';
                        }

                        console.log(data);

                    },
                    error: function (xhr, type) {
                        alert('Ajax error!');
                    }

                })


            }



        }
    </script>





@endsection
